<?php

$logo = '';

// Initialize an URL to the variable
if(isset($_SERVER['HTTPS'])) {
  if ($_SERVER['HTTPS'] == "on") {
    $logo = "https://{$_SERVER['HTTP_HOST']}/theme/images/logo.svg";
  }
}

// Use get_headers() function
$headers = @get_headers($logo);

// Use condition to check the existence of URL
if($headers && strpos( $headers[0], '200')) {
  include_once('templates/core/Smarty.class.php');
  $smarty = new smarty();
  $smarty->assign('haslogo', 1);
  $smarty->assign('base', $_SERVER['HTTP_HOST']);
  $smarty->assign('logo', $logo);
} else {
  include_once('templates/core/Smarty.class.php');
  $smarty = new smarty();
  $smarty->assign('haslogo', 0);
}

?>